import java.io.*;
import java.nio.channels.FileChannel;
import java.util.*;

public class FileImporter {
   public static void main(String[] args)
   {
      File fil = new File("src/UDPClient.java");
//      FileImporter.printFileInfo(fil);
      fil = new File("src/");
      FileImporter.printFileInfo(fil);
   }

   static void printFileInfo(File fil)
   {
      System.out.println("Name= "+fil.getName());
      System.out.println("Path= "+fil.getPath());
      System.out.println("AbsolutePath= "+fil.getAbsolutePath());
      System.out.println("Parent= "+fil.getParent());
      System.out.println("exists= "+fil.exists());
      System.out.println("canWrite= "+fil.canWrite());
      System.out.println("canRead= "+fil.canRead());
      System.out.println("isFile= "+fil.isFile());
      System.out.println("isAbsolute= "+fil.isAbsolute());
      System.out.println("lastModified= "+(new Date(fil.lastModified()))  );
      System.out.println("length= "+fil.length());
      
      
      System.out.println("isDirectory= "+fil.isDirectory());
      if (fil.isDirectory()) {
         String fils[] = fil.list();
         for (int i=0; i<fils.length; ++i) {
            System.out.println("src/"+fils[i]);
            
            File fl = new File("src/"+fils[i]);
            printFileInfo(fl);
            
         }
      }
      else
      {
    	  
      }
      
      
      
      
      System.out.println("");
   }
   
   
   public static void copyFile(File in, File out) throws IOException {
       FileChannel inChannel = new FileInputStream(in).getChannel();
       FileChannel outChannel = new FileOutputStream(out).getChannel();
       try {
           inChannel.transferTo(0, inChannel.size(), outChannel);
       } catch (IOException e) {
           throw e;
       } finally {
           if (inChannel != null)
               inChannel.close();
           if (outChannel != null)
               outChannel.close();
       }
   } 

}
